package es

import (
	"fmt"
	"github.com/elastic/go-elasticsearch"
)

var EsDb *elasticsearch.Client

func InitEs() {
	var err error
	cfg := elasticsearch.Config{
		Addresses: []string{
			"http://123.60.187.43:9200",
		},
	}
	EsDb, err = elasticsearch.NewClient(cfg)
	if err != nil {
		fmt.Println("es,连接失败")
		return
	}
	fmt.Println("es,连接成功")

}
